<?php
class Mageex_Robot_Model_Observer 
{
	 /**
     * Enable/disable configuration
     */
    const XML_PATH_GENERATION_ENABLED = 'robot/general/enabled';

    /**
     * Cronjob expression configuration
     */
    const XML_PATH_CRON_EXPR = 'crontab/jobs/robot_process/schedule/cron_expr';
	
	public function process($schedule)
	{
		if (!Mage::getStoreConfigFlag(self::XML_PATH_GENERATION_ENABLED)) {
            return;
        }	
		try{
			$obj = Mage::getModel('robot/robot');
			$status = $obj->processImport();
		}catch(Exception $e){
				Mage::log($e->getMessage());
		}
		
		if($status){
			return;
		}
	}
	
}